package com.yumeng.generator;

import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 代码生成信息
 *
 * @author wxd
 * @date 2025/10/17 09:59
 */
@Getter
@Setter
@Accessors(chain = true)
public class GenInfo {

    private String parentPkgName;//父级包名

    private String moduleName;//模块名
    private BaseEntityType baseEntityType;
    private List<String> tables;
    private List<String> tablePrefixes;

    public void checkUseful(){
        //tablePrefixes 可为空
        if (StringUtils.isBlank(parentPkgName)
                || StringUtils.isBlank(moduleName)
                || baseEntityType == null
                || CollectionUtils.isEmpty(tables)){
            throw new GeneratorException("GenInfo 参数异常");
        }
    }

}
